fix(envoy-plugin): Source IP address resolution now uses x-forwarded-for header#38
Merged
PrimalPimmy merged 2 commits into5GSEC:mainfrom Feb 14, 2025
Merged
Conversation
0c1bc49 to
10d263e
Compare
Signed-off-by: Anurag Singh Rajawat <anuragsinghrajawat22@gmail.com>
Signed-off-by: Anurag Singh Rajawat <anuragsinghrajawat22@gmail.com>
10d263e to
fcf3033
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes # (issue)
This PR fixes the plugin to use the
x-forwarded-forheader to determine the real client (source) IP address. Ifx-forwarded-foris not present, the source address is used as a fallback.Does this PR introduce a breaking change?
No.
Checklist
<type>: <description>convention.Additional information for reviewer
Sample Event, some fields are removed for brevity:
{ "metadata": { "context_id": 27, "timestamp": 1739469010, "receiver_name": "Istio", "receiver_version": "1.23.2" }, "source": { "ip": "2401:4900:1c7a:133f:369c:76b3:ccb3:2e15", "port": 62213 }, "destination": { "ip": "10.244.0.43", "port": 8443 }, "request": { "headers": { "x-forwarded-for": "2401:4900:1c7a:133f:369c:76b3:ccb3:2e15,10.7.0.15", "x-forwarded-proto": "https", "x-request-id": "7ee7a9f8-87bf-406d-9b08-f2720ed3f585" } }, "protocol": "HTTP/2" }Mention if this PR is part of any design or a continuation of previous PRs